What is .mdf and .ldf file in SQL Server and where to locate these files in MS SQL Server?
What is .mdf and .ldf file in SQL Server and where to locate these files in MS SQL Server?
516
27-Jan-2023
Updated on 27-Jan-2023
Ashutosh Patel
29-Jan-2023Microsoft SQL Server is a relational database management system (RDBMS). It is a software product that stores and retrieves the data requested by other applications. It stored the data in the form of a table (row and column).
There are two different files used are d by SQL servers named .mdf and .ldf. the file with mdf stands for the main data file or master database file and ldf stands for the log data file. .mdf file stores all the data and information related to users in the table and ldf file records all the transactions and changes to the database.
Location of .mdf and .ldf files in MS SQL Server:
First, open Microsoft SQL Server then selects your database name from object explorer -> Right click on your database name -> Click on its property -> From the open popup Select the Files option on the right side -> then see the right side in the popup in the table has a column name ‘Path’. This is the location of the .mdf and .ldf files of the database.